import './assets/sass/main.scss'
import service from './pages/service'

let app = angular
    .module('auth', [ 'ui.bootstrap', 'ui.router', 'pasp.ui', 'ngCookies' ])
    .factory('CommonService', service.factory)
    .config($urlRouterProvider => { $urlRouterProvider.otherwise('/login')})
    /*.run(($rootScope, $state, $cookies) => {
        "ngInject"
        $rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){
            // 如果是进入登录界面则允许
            if( toState.name =='login' ) {
                $rootScope.isLogin = false;
                return;
            }

        });
    });*/
/**
 * 页面加载
 */
let pageModules = require.context('./pages/', true, /\.index.js$/);
pageModules.keys().forEach(pageModules);

export default app;